package me.zhengjie.modules.management.rest.admin;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.Log;
import me.zhengjie.modules.management.domain.MrAttention;
import me.zhengjie.modules.management.service.MrAttentionService;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * @Author: chenxin.jiang
 * @Date: 2020/12/15
 * @Description:
 */
@RestController
@RequiredArgsConstructor
@Api(tags ="MR:注意事项信息")
@RequestMapping("/api/Attention")
public class MrAttentionController {
    private final MrAttentionService mrAttentionService;
    @PostMapping
    @Log("新增注意事项信息")
    @ApiOperation("新增注意事项信息")
    public void addMrAttention(@RequestBody @Valid MrAttention mrAttention){
        mrAttentionService.addAttention(mrAttention);
    }

    @DeleteMapping
    @Log("删除注意事项信息")
    @ApiOperation("删除注意事项信息")
    public void deleteMrAttention(@RequestBody List<Integer> ids){
        mrAttentionService.deleteAttention(ids);
    }

    @PutMapping
    @Log("更新注意事项信息")
    @ApiOperation("更新注意事项信息")
    public void updateMrAttention(@RequestBody @Valid MrAttention mrAttention){
        mrAttentionService.updateAttention(mrAttention);
    }

    @GetMapping
    @Log("查询注意事项信息")
    @ApiOperation("查询注意事项信息")
    public Object queryMrAttention(){
        return mrAttentionService.queryAttention();
    }
}
